import { EventMgr } from "../../../Framework/Scripts/Managers/EventMgr"
import { _decorator, Component, Node, ProgressBar } from 'cc';
import { UIComponent, UIMgr } from '../../../Framework/Scripts/Managers/UIMgr';
const { ccclass, property } = _decorator;

@ccclass('UILoading_UICtrl')
export class UILoading_UICtrl extends UIComponent {
    private progressBar: ProgressBar = null
    onLoad(){
     
        
        this.progressBar = this.ViewNode("ProgressBar").getComponent(ProgressBar)
        EventMgr.Instance.AddEventListener("load",this.upProgress,this)
    }

    private upProgress(name:string,data){
          this.progressBar.progress=data
    }

    onDestroy(){
        EventMgr.Instance.RemoveEventListener("load",this.upProgress,this)

    }
    
    start() {

    
        

    }
    

    update(deltaTime: number) {

    }
}


